import request from '@/utils/request'

// 查询销售产品列表
export function listSalesProducts(query) {
  return request({
    url: '/sales/salesProducts/list',
    method: 'get',
    params: query
  })
}

// 查询销售产品详细
export function getSalesProducts(productId) {
  return request({
    url: '/sales/salesProducts/' + productId,
    method: 'get'
  })
}

// 新增销售产品
export function addSalesProducts(data) {
  return request({
    url: '/sales/salesProducts',
    method: 'post',
    data: data
  })
}

// 修改销售产品
export function updateSalesProducts(data) {
  return request({
    url: '/sales/salesProducts',
    method: 'put',
    data: data
  })
}

// 删除销售产品
export function delSalesProducts(productId) {
  return request({
    url: '/sales/salesProducts/' + productId,
    method: 'delete'
  })
}

// 查询产品列表
export function productsListSelect() {
  return request({
    url: '/sales/salesProducts/productsList',
    method: 'get'
  })
}

// 生成生产计划
export function productPlan(data) {
  return request({
    url: '/sales/salesProducts/productPlan',
    method: 'post',
    data: data
  })
}
